1. Field of Invention
The present invention relates to a database recovery apparatus and method of using a dual plane nonvolatile memory and, more particularly, to a database recovery apparatus and method of using a block-based dual plane nonvolatile memory.
2. Information Disclosure Statement
Although a disc is mainly used as the medium for storing a database in the prior art, there has emerged a main memory database system using a memory of large capacity due to the development of semiconductor technology.
The main memory database system requires a recovery algorithm to maintain the consistency of the database. The update of specific data in the database, being different from the general update, must maintain the consistency of all other stored data by recovering the original data even upon the occurrence of an error during the update.
The disc-based shadow page technology, one of the recovery methods for maintaining database consistency, has an original and a copy of the database at the time of performing the transaction for updating data in the database.
FIG. 1 is a block diagram to illustrate the data recovery method from a database based on a conventional disc-based shadow page technology.
In general, the database is stored in the disc and divided into several blocks made up of page units. To update the data of the database stored in the disc at the time of performing the transaction, an original first block (100) is copied to a thirdblock (101) of the main memory. The third block (101) is updated and then copied to a second block (102), which is a disc area different from the first block (100).
Such recovery method requires a page table for mapping the database processing program to the block since the block is moved. Since the page table is stored in the disc, which is a stable memory, there is a disadvantage in that the page table must also be updated after the update of each data of the database.
Another disadvantage of the conventional disc-based shadow page technology is that small unit locking is difficult. The terminology "small unit locking" means allowing a plurality of processes to concurrently use a plurality of records which are different from each other. That is, database system can be concurrently accessed by various processes. If one block of data in the database is concurrently accessed by various processes, the database cannot have consistency. To prevent this inconsistency, a mark is tacked onto the block before using the block in the prior art. That is, the block is accessed after locking so as to make other processes wait. After use, the locking is released to allow other processes to access the block.
In the conventional disc-based database system, the original block must be copied to the main memory to update the block. The block is composed of units of pages and each page is composed of a plurality of records.
Using the functions of small unit locking, the concurrent use capabilities are increased so that the performance of a system is improved.
The modified content of the record, which each process accesses, is recorded in a log buffer in a log-based recovery technology, in contrast to the shadow page technology, where the modified content of is directly recorded to the record, which can cause problems to occur.
As an example, FIG. 1 depicts a case in which two transactions access records in various portions of a first block (100). After copying the first block (100) to the main memory, the two transactions perform the update after locking the records in various portions of the third block (101). If both of the transactions succeed, the transactions are completed after copying the third block (101) to the second block (102), which is a disc area different from the first block (100), and updating the page table. However, if one transaction succeeds and the other fails, the transaction can not be withdrawn or completed.
As described above, the data recovery from a database by the conventional disc-based shadow page method has problems in that the page table must be maintained and the small unit locking is difficult to achieve.